import req from '../utils/http'

//获取新闻分类列表
export function getNewCategoryList(){
    return req.post(`/api/cms/category/open/list?pageNum='2'&pageSize=2`)
}

//获取轮播图
export function getSwiperList(){
    return req.post(`/api/cms/article/open/banner/list?pageNum='2'&pageSize=2`)
}

//获取新闻列表
export function getNewList(pageNum,pageSize,categoryId){
    let parms1 = new URLSearchParams()
    parms1.append("pageNum",pageNum)
    parms1.append("pageSize",pageSize)
    parms1.append("categoryId",categoryId)

    return req.post(`/api/cms/article/open/list`,parms1)
}

//获取热门新闻标题
export function getHotNewList(){
    return req.post(`/api/cms/article/open/hot/list?pageNum=1&pageSize=100`)
}

//获取新闻详情
export function getNewDetails(articleId){
    return req.get(`/api/cms/article/open/detail/${articleId}`)
}
